<template>
  <div class="app-container">
    <NavBar
      v-if="$route.meta.title!=='首页'"
      :title="$route.meta.title"

      left-arrow
      @click-left="()=>{
        $router.go(-1)
      }"
    />
    <div class="layout-content">
      <keep-alive v-if="$route.meta.keepAlive">
        <router-view></router-view>
      </keep-alive>
      <router-view v-else></router-view>
    </div>

    <van-tabbar route>
      <van-tabbar-item   @click="goHome" icon="home-o">首页</van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
import TabBar from '@/components/TabBar'
import {NavBar} from 'vant'
export default {
  name: 'AppLayout',
  data() {
    return {
      tabbars: [
        {
          title: '首页',
          to: '/home',
          icon: 'home-o'
        },
        // {
        //   title: '关于我',
        //   to: {
        //     name: 'About'
        //   },
        //   icon: 'user-o'
        // }
      ]
    }
  },
  components: {
    TabBar,NavBar
  },
  methods: {
    goHome(){
      location.href = '/wexin/#/home'
    },
    handleChange(v) {
      debugger
      console.log('tab value:', v)
    }
  }
}
</script>
